package com.nova.bluetooth.ui.ai;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.nova.bluetooth.R;
import com.nova.bluetooth.base.BaseFragment;
import com.nova.bluetooth.databinding.FragmentDeviceTabBinding;
import com.nova.bluetooth.databinding.FragmentRecordingTranslateBinding;
import com.nova.bluetooth.helpUtils.OnClickEvent;
import com.nova.bluetooth.manage.AiUiManager;
import com.nova.bluetooth.webIat.WebXunFeiTWS;

/**
 * 同声传译-边录音边翻译
 */
public class RecordingTranslationFragment extends BaseFragment implements WebXunFeiTWS.OnIATWSRecognizeListener {
    private FragmentRecordingTranslateBinding binding;
    private WebXunFeiTWS webIATWSManage;
    private String mLeftLanguageName = "普通话";
    private String mRightLanguageName = "英语";
    private String asrLanguageCode = "zh_cn";
    private String translateLanguageCode = "en";

    private String asrLanguageAccentCode = "mandarin";
    private int asrLanguageAccentType = 1; //1语言 2方言

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_recording_translate, container, false);
        binding = FragmentRecordingTranslateBinding.bind(view);
        binding.setOnClick(onClickEvent);
        initData();
        initView();
        return binding.getRoot();
    }

    private void initView() {

    }

    private void initData(){
        AiUiManager.getInstance().initSDK(getContext());
        webIATWSManage = WebXunFeiTWS.getInstance();
        webIATWSManage.clearDiscard();
        webIATWSManage.setOnIATWSRecognizeListener(this);
    }


    private final OnClickEvent onClickEvent = new OnClickEvent() {
        @Override
        public void singleClick(View v) {
            if (v.getId() == R.id.iv_back){
                getActivity().finish();
            }
        }
    };

    @Override
    public void onWebAsrResult(String result, int status) {

    }

    @Override
    public void onWebRecordStatus(boolean recording) {

    }

    @Override
    public void onWebStartSpeaking() {

    }
}
